﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MySql.Data.MySqlClient;

namespace WaveMaster.Holidays.Club.Domain
{
    public class TicketDeduction
    {
        public long m_deductID;
        public TravelAgent m_travelAgent;
        public string m_code;
        public DateTime m_transactionDate;
        public decimal m_quantity;
        public TicketType m_ticketType;
        public string m_remark;
        public DateTime m_cretnDate;
        public long m_cretnBy = 0;
        public DateTime m_modfctnDate;
        public long m_modfctnBy = 0;
        public TicketDeduction() { }
        public TicketDeduction(long id)
        {
        }
        public TicketDeduction(MySqlDataReader rd)
        {
            m_deductID = Convert.ToInt64(rd["m_deductID"]);
            m_travelAgent = new TravelAgent(Convert.ToInt64(rd["m_travelAgentId"]));
            m_code = rd["m_code"].ToString();
            m_transactionDate = Convert.ToDateTime(rd["m_transactionDate"]);
            m_quantity = Convert.ToDecimal(rd["m_quantity"]);
            m_ticketType = (TicketType)Enum.Parse(typeof(TicketType), rd["m_ticketType"].ToString());
            m_remark = rd["m_remark"].ToString();

            m_cretnDate = Convert.ToDateTime(rd["m_cretnDate"]);
            m_cretnBy = Convert.ToInt64(rd["m_cretnBy"]);
            m_modfctnDate = Convert.ToDateTime(rd["m_modfctnDate"]);
            m_modfctnBy = Convert.ToInt64(rd["m_modfctnBy"]);
        }

    }
}
